function M2Precon() {
};

M2Precon.instance = function(callbackFunc) {
  var _self = this;
  
  var model = Model.instance('{{$smarty.const.MODEL_NAME_PRECON|escape:javascript}}', '{{$smarty.const.MODEL_TITLE_PRECON|escape:javascript}}', '{{$smarty.const.MODEL_TYPE_ORDER|escape:javascript}}');
  
  //Create model here...
  var state1 = State.instance(0, 'Inactived', null);
  var state2 = State.instance(1, 'Arrange a pre wedding consulation', function(status, now) { return parseInt(((SimpleDate.toStamp(status.date) - (21 * 86400)) - SimpleDate.toStamp(now)) / 86400, 10); });
  var state3 = State.instance(2, 'Pre wedding consulation has been arranged', null);
  var transition1 = Transition.instance('Arrange now', state2, state3, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}');
  
  model.states = [ state1, state2, state3 ];
  model.transitions = [ transition1 ];
  return model;
};